<!--
 * @Description: 
 * @Autor: dyx
 * @Date: 2023-05-30 13:53:07
 * @LastEditTime: 2023-06-02 13:40:13
-->
<template>
  <transition name="el-zoom-in-center">
    <div class="JADP-preview-main">
      <div class="JADP-common-page-header">
        <el-page-header @back="goBack" content="档案管理"> </el-page-header>
        <div class="options">
          <!-- <el-button
            type="primary"
            @click="dataFormSubmit()"
            v-if="!isDetail"
            :loading="btnLoading"
            >确 定</el-button
          > -->
          <el-button @click="goBack">取 消</el-button>
        </div>
      </div>
      <el-row :gutter="15" class="main">
        <el-tabs v-model="activeName" tabPosition="left" @tab-click="handleClick">
          <el-tab-pane label="教学实施计划表" name="teachingImplementationSchedule">
            <A1_JXSSJHB ref="A1_JXSSJHB" />
          </el-tab-pane>
          <el-tab-pane label="培训课程表" name="trainingSchedule" v-if="isEvidenceCollection">
            <A2_PXKCB ref="A2_PXKCB" />
          </el-tab-pane>
          <el-tab-pane label="安全生产培训考试考场记录表" name="examRecordForm" v-if="!isEvidenceCollection">
            <A16_AQSCPXKSKCJLB ref="A16_AQSCPXKSKCJLB" />
          </el-tab-pane>
          <el-tab-pane label="“三项岗位人员”持证情况汇总表" name="threePositionForm" v-if="!isEvidenceCollection">
            <A17_SCJYDWAQSCCZQKHZB ref="A17_SCJYDWAQSCCZQKHZB" />
          </el-tab-pane>
          <el-tab-pane label="教案审批表" name="teachingPlanApprovalForm" v-if="isEvidenceCollection">
            <A3_JASPB ref="A3_JASPB" />
          </el-tab-pane>
          <el-tab-pane label="培训学员登记表" name="traineeRegistrationForm" v-if="isEvidenceCollection">
            <A4_PXXYDJB ref="A4_PXXYDJB" />
          </el-tab-pane>
          <el-tab-pane label="培训学员名册表" name="rosterOfTrainees" v-if="isEvidenceCollection">
            <A5_PXXYMCB ref="A5_PXXYMCB" />
          </el-tab-pane>
          <el-tab-pane label="培训学员学习记录表" name="traineeLearningRecordForm">
            <A6_PXXXKQQDB ref="A6_PXXXKQQDB" />
          </el-tab-pane>
          <el-tab-pane label="培训日志表" name="trainingLogSheet" v-if="isEvidenceCollection">
            <A7_PXRZB ref="A7_PXRZB" />
          </el-tab-pane>
          <el-tab-pane label="培训班总结表" name="trainingCourseSummary" v-if="isEvidenceCollection">
            <A8_PXBZJB ref="A8_PXBZJB" />
          </el-tab-pane>
          <!-- <el-tab-pane label="年度培训计划表" name="annualTrainingSchedule">
            <A9_NDPXJHB ref="A9_NDPXJHB" />
          </el-tab-pane> -->
          <el-tab-pane label="教师情况登记表" name="teacherRegistrationForm" v-if="isEvidenceCollection">
            <A10_JSQKDJB ref="A10_JSQKDJB" />
          </el-tab-pane>
          <el-tab-pane label="课堂教学评价表" name="classroomTeachingEvaluationForm" v-if="isEvidenceCollection">
            <A12_KTJXPJB ref="A12_KTJXPJB" />
          </el-tab-pane>
          <el-tab-pane label="教师教学质量评估表" name="teacherTeachingQualityEvaluationForm" v-if="isEvidenceCollection">
            <A13_JSJXZLPGB ref="A13_JSJXZLPGB" />
          </el-tab-pane>
          <el-tab-pane label="培训课程设计评价表" name="trainingCourseDesignEvaluationForm" v-if="isEvidenceCollection">
            <A14_PXKCSJPJB ref="A14_PXKCSJPJB" />
          </el-tab-pane>
          <el-tab-pane label="教研活动记录表" name="recordsOfTeachingAndResearchActivities" v-if="isEvidenceCollection">
            <A15_JYHDJLB ref="A15_JYHDJLB" />
          </el-tab-pane>
        </el-tabs>
      </el-row>
    </div>
  </transition>
</template>
<script>
import request from "@/utils/request";
import A1_JXSSJHB from "./components/A1_JXSSJHB.vue";
import A2_PXKCB from "./components/A2_PXKCB.vue";
import A3_JASPB from "./components/A3_JASPB.vue";
import A4_PXXYDJB from "./components/A4_PXXYDJB.vue";
import A5_PXXYMCB from "./components/A5_PXXYMCB.vue";
import A6_PXXXKQQDB from "./components/A6_PXXXKQQDB.vue";
import A7_PXRZB from "./components/A7_PXRZB.vue";
import A8_PXBZJB from "./components/A8_PXBZJB.vue";
import A9_NDPXJHB from "./components/A9_NDPXJHB.vue";
import A10_JSQKDJB from "./components/A10_JSQKDJB.vue";
import A12_KTJXPJB from "./components/A12_KTJXPJB.vue";
import A13_JSJXZLPGB from "./components/A13_JSJXZLPGB.vue";
import A14_PXKCSJPJB from "./components/A14_PXKCSJPJB.vue";
import A15_JYHDJLB from "./components/A15_JYHDJLB.vue";
import A16_AQSCPXKSKCJLB from "./components/A16_AQSCPXKSKCJLB.vue";
import A17_SCJYDWAQSCCZQKHZB from "./components/A17_SCJYDWAQSCCZQKHZB.vue";
export default {
  components: {
    A1_JXSSJHB,
    A2_PXKCB,
    A3_JASPB,
    A4_PXXYDJB,
    A5_PXXYMCB,
    A6_PXXXKQQDB,
    A7_PXRZB,
    A8_PXBZJB,
    A9_NDPXJHB,
    A10_JSQKDJB,
    A12_KTJXPJB,
    A13_JSJXZLPGB,
    A14_PXKCSJPJB,
    A15_JYHDJLB,
    A16_AQSCPXKSKCJLB,
    A17_SCJYDWAQSCCZQKHZB
  },
  provide() {
    return {
      classid: this.dataForm.id
    };
  },
  data() {
    return {
      loading: false,
      visible: false,
      activeName: "teachingImplementationSchedule",
      dataForm: {},
      isEvidenceCollection: false,
    };
  },
  computed: {},
  watch: {},
  created() { },
  mounted() { },
  methods: {
    goBack() {
      this.$emit("refresh");
    },
    init(row) {
      console.log(row);
      if (row.train_type == 'b986805f5dbd4eff9479d670ae7f2a29') {
        this.isEvidenceCollection = true;
      }
      console.log(row, this.isEvidenceCollection);

      this.rowData = row;
      this.dataForm.id = row.id || 0;
      this.visible = true;
      this.$nextTick(() => {
        this.$refs.A1_JXSSJHB.init(row.id);
        // this.$refs.A2_PXKCB.init(id);
        // this.$refs.A3_JASPB.init(id);
        // // this.$refs.A4_PXXYDJB.init(id);
        // this.$refs.A5_PXXYMCB.init(id);
        // this.$refs.A7_PXRZB.init(id);
        // this.$refs.A8_PXBZJB.init(id);
        // // this.$refs.A9_NDPXJHB.init(id);
        // // this.$refs.A10_JSQKDJB.init(id);
        // this.$refs.A12_KTJXPJB.init(id);
        // this.$refs.A13_JSJXZLPGB.init(id);
        // this.$refs.A14_PXKCSJPJB.init(id);
        // this.$refs.A15_JYHDJLB.init(id);
        // this.$refs.TLTSchedule.init(id);
        // this.$refs["elForm"].resetFields();
        // if (this.dataForm.id) {
        //   this.loading = true;
        //   request({
        //     url: "/api/class_archives/generateA1/" + this.dataForm.id,
        //     method: "get"
        //   }).then(res => {
        //     this.dataForm = res.data;
        //     this.loading = false;
        //   });
        // }
      });
    },
    handleClick(tab) {
      // console.log(tab, event);
      let id = this.dataForm.id;
      switch (tab.name) {
        case "teachingImplementationSchedule":
          this.$refs.A1_JXSSJHB.init(id);
          break;
        case "trainingSchedule":
          this.$refs.A2_PXKCB.init(id);
          break;
        case "teachingPlanApprovalForm":
          this.$refs.A3_JASPB.init(id);
          break;
        case "rosterOfTrainees":
          this.$refs.A5_PXXYMCB.init(id);
          break;
        case "traineeLearningRecordForm":
          this.$refs.A6_PXXXKQQDB.init(id, true);
          break;
        case "trainingLogSheet":
          this.$refs.A7_PXRZB.init(id);
          break;
        case "trainingCourseSummary":
          this.$refs.A8_PXBZJB.init(id);
          break;
        case "classroomTeachingEvaluationForm":
          this.$refs.A12_KTJXPJB.init(id);
          break;
        case "teacherTeachingQualityEvaluationForm":
          this.$refs.A13_JSJXZLPGB.init(id);
          break;
        case "trainingCourseDesignEvaluationForm":
          this.$refs.A14_PXKCSJPJB.init(id);
          break;
        case "recordsOfTeachingAndResearchActivities":
          this.$refs.A15_JYHDJLB.init(id);
          break;
        case "examRecordForm":
          this.$refs.A16_AQSCPXKSKCJLB.init(id);
          break;
        case "threePositionForm":
          this.$refs.A17_SCJYDWAQSCCZQKHZB.init(id);
          break;
        case "traineeRegistrationForm":
          this.$refs.A4_PXXYDJB.init(id);
          break;
        case "teacherRegistrationForm":
          this.$refs.A10_JSQKDJB.init(id);
          break;
        default:
          this.$refs.A1_JXSSJHB.init(id);
          break;
      }
    }
  }
};
</script>

<style lang="scss" scoped>
::v-deep .el-tabs--left {
  height: 100%;
}
</style>
